﻿using ExaminationSystem.EntityFrameworkCore;
using Microsoft.AspNetCore.Mvc;
using System.Linq;

namespace ExaminationSystem.Web.Controllers
{
    [Route("[controller]")]
    [ApiController]
    //[EnableCors("any")]  // 允许跨域的配置
    public class LogicController : ControllerBase
    {
        public ExaminationSystemDbContext _context { get; }

        public LogicController(ExaminationSystemDbContext context)
        {
            _context = context;
        }

        [HttpGet]
        public bool Get(string userNo,string password)
        {
            return _context.Users.Any(m => m.UserName == userNo && m.Password == password); 
        }
    }
}
